package com.caits.lbs.framework.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;

import com.caits.lbs.bean.dbmodel.ETBase;

/**
 * @author Administrator
 *
 */
public interface IBusinessDAO{

	/**
	 * 按MAP条件查询某业务总数
	 *
	 */
	Long queryBusinessCount(String sqlId,Map<String, Object> paramMap) throws SQLException;
	
	/**
	 * 按SQL ID查
	 * @param <T>
	 * @param sqlId
	 * @return
	 * @throws SQLException
	 */
	<T> List<T> queryList(String sqlId) throws SQLException;
	/**
	 * 按MAP条件查询业务列表
	 *
	 */
	List<ETBase> queryBusinessList(String sqlId,Map<String, Object> paramMap) throws SQLException;

	/**
	 * 按ETBase对象查询某业务总数
	 *
	 */
	Long queryBusinessCount(String sqlId,ETBase e) throws SQLException,DataAccessException;
	/**
	 * 按ETBase对象查询业务列表
	 *
	 */
	List<ETBase> queryBusinessList(String sqlId,ETBase e) throws SQLException,DataAccessException;
	/**
	 * 按MAP添加业务对象
	 *
	 */
	Map<String, Object> addBusiness(String sqlId,Map<String, Object> paramMap) throws SQLException,DataAccessException;
	
	/**
	 * 批量更新/插入数据 
	 * @param sqlId 要执行的sql标识
	 * @param list	对象参数列表
	 * @return	map，按序号，每次更新的结果为值
	 * @throws SQLException
	 */
	public Map<String, Object> addBussinessList(String sqlId,List<Map<String,Object>> list) throws SQLException,DataAccessException;
	/**
	 * 按MAP删除业务对象
	 *
	 */
	Map<String, Object> deleteBusiness(String sqlId,Map<String, Object> paramMap) throws SQLException,DataAccessException;
	/**
	 * 按MAP修改业务对象
	 *
	 */
	Map<String, Object> modifyBusiness(String sqlId,Map<String, Object> paramMap) throws SQLException,DataAccessException;
	
	/**
	 * 按ETBase对象添加业务对象
	 *
	 */
	Map<String, Object> addBusiness(String sqlId,ETBase e) throws SQLException,DataAccessException;
	/**
	 * 按ETBase对象删除业务对象
	 *
	 */
	Map<String, Object> deleteBusiness(String sqlId,ETBase e) throws SQLException,DataAccessException;
	/**
	 * 按ETBase对象修改业务对象
	 *
	 */
	Map<String, Object> modifyBusiness(String sqlId,ETBase e) throws SQLException,DataAccessException;
	/**
	 * 查询单个业务对象
	 * @param sqlId
	 * @param paramMap
	 * @return
	 * @throws SQLException
	 */
	ETBase queryBusiness(String sqlId, Map<String, Object> paramMap) throws SQLException,DataAccessException;

	/**
	 * 按MAP条件查询业务列表 
	 * @param <T>
	 * @param sqlId
	 * @param paramMap
	 * @return
	 * @throws SQLException
	 */
	<T> List<T> queryList(String sqlId, Map<String, Object> paramMap) throws SQLException,DataAccessException;
	
	/**
	 * 按ETBase对象 条件查询业务列表 
	 * @param <T>
	 * @param sqlId
	 * @param e
	 * @return
	 * @throws SQLException
	 */
	<T> List<T> queryList(String sqlId, ETBase e) throws SQLException,DataAccessException;

}
